{extend name="base" /}
{block name="css"}
{css href="__CSS__/address.css" /}
{/block}
{block name="body"}
<!-- 主要内容 开始 -->
<div class="weui-tab__bd-item">
    <header class="weui-navBar weui-navBar-fixed">
        <a href="javascript:history.go(-1);" class="weui-navBar-item">
            <i class="icon iconfont icon-fanhui"></i>
        </a>
        <div class="weui-center">
            <span class="weui-center-title">我的地址</span>
        </div>
        <a href="javascript:;" class="weui-navBar-item">
        </a>
    </header>
    {volist name="data" id="v" empty="$empty"}
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-address-img">
                <img src="__IMG__/icon-fj.png" alt="">
            </div>
            <div class="weui-flex-box">
                <strong>
                    {$v.consignee}  <span>{$v.mobile}</span>
                </strong>
                <p>{$v.province} {$v.city} {$v.district} {$v.address}</p>
            </div>
            <div class="weui-text-copy" data-url="{$v.id}">
                修改
            </div>
        </div>
    </div>
    {/volist}
    <div class="weui-btn-area">
        <button class="weui-btn weui-btn_primary btn">新增地址</button>
    </div>
</div>
<!-- 主要内容 结束 -->
{/block}
{block name="js"}
<script type="text/javascript">
$(function(){
    $('.weui-text-copy').click(function() {
        var url = $(this).data('url');
        $(location).attr('href', 'address_edit/type/'+url+'.html');
    });
    //新增
    $('.btn').click(function() {
        var url = $(this).data('url');
        $(location).attr('href', 'address_add.html');
    });
});
</script>
{/block}